<template>
  <div>
    <index2 ref="mychild"></index2>
    <button @click="index">anniu</button>
    <button @click="export_fnc">123123</button>
  </div>
</template>

<script>
import index2  from './index2'
  export default {
    name: 'index',
    data() { // 数据定义
      return {
      }
    },
    mounted:function(){
      asd();
    },
    methods: {
      index(){
        this.$refs.mychild.index2();//调用子组件的方法childClick
      },
      export_fnc(){
        alert('');
      }
    },
    components:{
      index2
    }
  }
</script>

